//导入request.js请求工具
import request from '@/utils/request.js'
//注册接口
export const userRegisterService = (userRegisterData)=>{
    console.log(userRegisterData);
    const params = new URLSearchParams()
    for(let key in userRegisterData){
        params.append(key,userRegisterData[key]);
    }
    return request.post('/user/register',params);
}
export const userLoginService = (userLoginData)=>{
    const params = new URLSearchParams()
    for(let key in userLoginData){
        params.append(key,userLoginData[key]);
    }
    return request.post('/user/login',params)
}
export const userInfoService = ()=>{
    return request.get('/user/userInfo');
}
export const userInfoUpdateService = (userNewInfo)=>{
    return request.put('user/update',userNewInfo)
}
export const userpasswordUpdateService = (data)=>{
    return request.put('user/updatePwd',data)
}
export const userInfoUpdateAvatarService = (userNewInfo)=>{
    return request.put('user/updateavatar',userNewInfo)
}